/*
 *  isutil.h
 *  RGS
 *
 *  Copyright 2008 Ivan Safrin.
 *
 *  This code is distributed under the LGPL license.
 *  You should have a copy of LGPL.txt distributed
 *  with the project, but if not you can get a copy
 *  at http://www.gnu.org/licenses/
 *
 */

#ifndef _IS_UTIL_H_
#define _IS_UTIL_H_

#ifdef _WINDOWS
	#define DECLSPEC __declspec(dllexport)
#else
	#define DECLSPEC
#endif

#ifdef __cplusplus
extern "C" {
#endif

/* @package Utils */
/* @beginmodule Array */

typedef struct {
	long length;
	long itemSize;
	void **data;
} ISArray;

extern DECLSPEC void ISArray_PushElement(ISArray *array, void *newItem);
extern DECLSPEC void *ISArray_CreateElement(ISArray *array);
extern DECLSPEC int ISArray_HasElement(ISArray *array, void *element);
extern DECLSPEC int ISArray_RemoveElement(ISArray *array, void *element);
extern DECLSPEC ISArray *ISArray_Create(long itemSize);
extern DECLSPEC void ISArray_Clear(ISArray *array);

/* @beginmodule String */

typedef struct {
	char *text;
	long length;
} ISString;

extern DECLSPEC ISString *ISString_Create(char *data);
extern DECLSPEC void ISString_SetText(ISString *string, char *newText);
extern DECLSPEC void ISString_Destroy(ISString *string);

/* @endmodule */

#ifdef __cplusplus
}
#endif


#endif

